/*
 * Copyright (C) 2018 Donlon.
 *
 * 2018秋季C语言练习题（3）
 * http://10.105.242.83/contest/460/
 *
 * C. 摄氏度与华氏度
 */

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {
  float temperature_fahrenheit;
  float temperature_celsius;
  char level;

  scanf("%f", &temperature_fahrenheit);

  temperature_celsius = (temperature_fahrenheit - 32.f) / 1.8f;

  if (temperature_celsius < 0) {
    level = 'A';
  } else if (temperature_celsius < 20) {
    level = 'B';
  } else if (temperature_celsius < 40) {
    level = 'C';
  } else {
    level = 'D';
  }

  printf("%c:%.1f", level, temperature_celsius);
}
